@extends('layouts.app')

@section('content')



<script src="{{ URL::asset('/') }}js/html2canvas.js"></script>




<script type="text/javascript">
function takeScreenshot() {
  console.log('test');
    html2canvas(document.getElementById('view'), {
        onrendered: function(canvas) {
            console.log(canvas);
            var myImage = canvas.toDataURL("image/jpeg");  //base64
             console.log(myImage);

             var urls = "{{url('admin/case/xquploads')}}";
             var casid = "{{$case->case_id}}";
             

            //并将图片上传到服务器用作图片分享  
            $.ajax({  
                type : "POST",  
                url : urls,  
                 data: {'img':myImage,'_token':'{{csrf_token()}}','caseid':casid},
                dateType: 'json',    
               
                success : function(data){
                    var obj = eval( "(" + data + ")" );
                     console.log(obj);
                     if (obj.style == 1) {
                       alert(obj.message);
                       self.location= "{{url('admin/case/index')}}"; 
                     }
                    
                
                    
                    // $('#myShowImage').attr('src', '${ctxStatic}/usertemp/'+data+'.jpg'); //服务器上保存图片路径，data是返回的文件名。  
                }  
            });  

            document.body.appendChild(canvas);
        },
      width: 900,
      height: 955,
    });
}
</script>



     <div class="content">
        <div class="main-content">
    
          <div class="row">
             <button class="btn btn-primary" onclick="takeScreenshot()">提交</button>
              <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>


                <div class="form" id="view" style="background-color: #FFF;width:900px;height:955px;">
                  <div class="table_unit">
                    <div class="center-block mg_b36">
                      <span class="input_tit">{{$user->name}}</span>
                    </div>
                    <h1 class="form_tit">责令限期<span class="dsp w120"></span>通知书</h1>
                    <div class="form_head_r">
                      X公（<p class="input_hd"></p>）限字〔<p class="input_hd"></p>〕第<p class="input_hd"></p>号
                    </div>
                    <p class="hg2"></p>
                    <div class="phg mg_50 tx_d2 line_h1">根据《公安机关监督检查企业事业单位内部治安保卫工作规定》第四条、第五条之规定，我单位工作人员<span class="dsl"></span>于<span class="dsl"></span>{{$case->case_checktime}}对你单位进行检查，发现存在下述违法行为：<span class="dsl">{{$case->case_desc}}</span>
                    </div>
                    <p class="hg8"></p>
                    <div class="phg mg_50 tx_d2 line_h1">根据《企业事业单位内部治安保卫条例》第十九条之规定，现责令你单位在{{$headline->end}}前完毕，并将结果函告我单位。在期限届满之前，你单位必须<span class="txt-und">加强防范、确保安全</span>。</div>
                    <p class="hg5"></p>
                    <div class="form_right">
                      <p>（公安机关印章）</p>
                      <div class="form_time">
                        <span class="w80 bdno"></span>年<span class="w80 bdno"></span>月<span class="w80 bdno"></span>日
                      </div>
                    </div>
                    <p class="hg2"></p>
                    <div class="form_unit">
                      <p>被检查单位：<span class="input_b bdno">{{$unit->name}}</span></p> 
                      <div class="dsp">
                        <span class="w80 bdno"></span>{{$headline->created_at}}
                      </div>
                    </div>
                  </div>
                </div>      
          <!--<div class="btn-toolbar list-toolbar btn-toolbar2">
            <button class="btn btn-primary">确定</button>
            <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>
          </div>-->
        </div>

      </div>

           
        </div>

   


@stop
